<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<h1 class="page-header">Thông tin tài khoản</h1>
<?php if (Yii::app()->user->hasFlash('error')): ?>
    <div class="alert alert-danger fade in">
        <button data-dismiss="alert" class="close" type="button">×</button>
        <?php echo Yii::app()->user->getFlash('error') ?>
    </div>
<?php endif; ?>
<?php if (Yii::app()->user->hasFlash('success')): ?>
    <div class="alert alert-success fade in">
        <button data-dismiss="alert" class="close" type="button">×</button>
        <?php echo Yii::app()->user->getFlash('success') ?>
    </div>
<?php endif; ?>
<div class="col-md-7 col-md-offset-2">
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'profile-form',
        'enableClientValidation' => true,
        'clientOptions' => array(
            'validateOnSubmit' => true,
        ),
        'htmlOptions' => array(
            'class' => 'form-horizontal'
        )
    ));
    ?>
    <div class="form-group">
        <label class="col-sm-4 control-label" for="fullname">Họ và tên</label>
        <div class="col-sm-8">
            <?php echo $form->textField($model, 'fullname', array('class' => 'form-control')); ?>
            <?php echo $form->error($model, 'fullname', array('class' => 'error-message')); ?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" for="email">Email</label>
        <div class="col-sm-8">
            <?php echo $form->textField($model, 'email', array('class' => 'form-control', 'disabled' => true)); ?>
            <?php echo $form->error($model, 'email', array('class' => 'error-message')); ?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" for="phone">Số điện thoại</label>
        <div class="col-sm-8">
            <?php echo $form->textField($model, 'phone', array('class' => 'form-control')); ?>
            <?php echo $form->error($model, 'phone', array('class' => 'error-message')); ?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label" for="address">Địa chỉ</label>
        <div class="col-sm-8">
            <?php echo $form->textArea($model, 'address', array('class' => 'form-control')); ?>
            <?php echo $form->error($model, 'address', array('class' => 'error-message')); ?>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-4 col-sm-8">
            <button type="submit" class="btn btn-primary">Cập nhật</button>
            <a class="btn btn-default" href="<?php echo $this->createUrl('user/changepassword'); ?>">Đổi mật khẩu</a>
        </div>
    </div>
    <?php $this->endWidget(); ?>
</div>

